Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dequeue ops in Hamiltonian.__matmul__ #5455

Merged
merged 2 commits into from
Apr 1, 2024
Merged

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Apr 1, 2024

Context:

A user was encountering issues where operations were remaining in the circuit after being used to construct a hamiltonian.

Description of the Change:

De-queue the arguments to Hamiltonian.__matmul__

Benefits:

No more things in the circuit that shouldn't be in the circuit.

Possible Drawbacks:

Related GitHub Issues:

Fixes #5454 [sc-60158]

@lillian542 lillian542 self-requested a review April 1, 2024 16:27
Copy link

codecov bot commented Apr 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.67%. Comparing base (1bb10be) to head (e5de547).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5455      +/-   ##
==========================================
- Coverage   99.68%   99.67%   -0.01%     
==========================================
  Files         402      402              
  Lines       37534    37253     -281     
==========================================
- Hits        37414    37132     -282     
- Misses        120      121       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@astralcai astralcai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 🎸

@albi3ro albi3ro merged commit 1a2895d into master Apr 1, 2024
40 checks passed
@albi3ro albi3ro deleted the fix-hamiltonian-queuing branch April 1, 2024 17:41
@@ -291,6 +291,9 @@

<h3>Bug fixes 🐛</h3>

* Using `@` with legacy Hamiltonian instances now properly de-queues the previously existing operations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens in the new-op-arithmetic setting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Things are properly de-queued.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Hamiltonians defined using operator arithmetic queuing extra gates
4 participants